diff options
| author | Adam Soltys <[email protected]> | 2022-12-27 22:49:25 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-12-27 22:49:25 -0800 |
| commit | b61377a19a2d1a9baf54f9e769c018cbcb6dac1c (patch) | |
| tree | 053265f969281e4cd7ae0cd1cb81ac686eb9956f /src/routes/(app)/[username]/(profile)/+page.server.js | |
| parent | ff6ef6d8e3e546fb2396bcac74383cb460c04b58 (diff) | |
| download | coinos-ui-b61377a19a2d1a9baf54f9e769c018cbcb6dac1c.tar.gz coinos-ui-b61377a19a2d1a9baf54f9e769c018cbcb6dac1c.zip | |
show follows and followers
Diffstat (limited to 'src/routes/(app)/[username]/(profile)/+page.server.js')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+page.server.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+page.server.js b/src/routes/(app)/[username]/(profile)/+page.server.js new file mode 100644 index 00000000..9c91efae --- /dev/null +++ b/src/routes/(app)/[username]/(profile)/+page.server.js @@ -0,0 +1,21 @@ +import { get } from '$lib/utils'; + +export async function load({ params, parent, url }) { + let { subject } = await parent(); + let { pubkey } = subject; + if (!pubkey) pubkey = params.username; + + let events = []; + + try { + events = await get(`/nostr/${pubkey}`); + } catch (e) { + console.log(`failed to fetch nostr events for ${pubkey}`, e); + } + + events.map((e) => { + e.seen = e.created_at; + }); + + return { events }; +} |
